package com.kingdee.eas.custom.hr.attendance.app;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.basedata.person.PersonFactory;
import com.kingdee.eas.basedata.person.PersonInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.hr.attendance.SpecialOperationCancleEntryInfo;
import com.kingdee.eas.custom.hr.attendance.SpecialOperationMgrEntryFactory;
import com.kingdee.eas.custom.hr.attendance.SpecialOperationMgrEntryInfo;
import com.kingdee.eas.hr.base.HRBillBaseEntryInfo;
import com.kingdee.eas.hr.base.HRBillStateEnum;
import com.kingdee.eas.hr.base.app.HRBillBizBean;

public class SpecialOperationCancleBizBean extends HRBillBizBean {

	public void _addnew(Context arg0, IObjectPK arg1, IObjectValue arg2)
			throws BOSException, EASBizException {

	}

	public void _beforeEffectBeforeBackJob(Context arg0,
			HRBillBaseEntryInfo arg1) throws BOSException, EASBizException {

	}

	public void _beforeEffectOnBackJob(Context arg0, HRBillBaseEntryInfo arg1)
			throws BOSException, EASBizException {

	}

	public void _beforeEffectOnNoJob(Context arg0, HRBillBaseEntryInfo arg1)
			throws BOSException, EASBizException {

	}

	public void _check(Context arg0, IObjectPK arg1, IObjectValue arg2)
			throws BOSException, EASBizException {

	}

	public void _delete(Context arg0, IObjectPK arg1) throws BOSException,
			EASBizException {

	}

	public void _entryEffect(Context ctx, HRBillBaseEntryInfo baseEntry)
			throws BOSException, EASBizException {
		SpecialOperationCancleEntryInfo entry = (SpecialOperationCancleEntryInfo) baseEntry;
		PersonInfo person = entry.getPerson();
		person.setIsSpecialCode(false);
		person.setSpecialOptCancleDate(entry.getEndDate());
		
		SelectorItemCollection selectors = new SelectorItemCollection();
		selectors.add("isSpecialCode");
		selectors.add("specialOptCancleDate");
		PersonFactory.getLocalInstance(ctx).updatePartial(person, selectors);

		SpecialOperationMgrEntryInfo info = entry.getSpecialOperationEntry();
		info.setEndDate(entry.getEndDate());
		selectors = new SelectorItemCollection();
		selectors.add("endDate");

		SpecialOperationMgrEntryFactory.getLocalInstance(ctx).updatePartial(
				info, selectors);
	}

	public void _processBeforeAddNew(Context arg0, IObjectValue arg1)
			throws BOSException, EASBizException {

	}

	public void _setBillState(Context arg0, BOSUuid arg1, HRBillStateEnum arg2)
			throws BOSException, EASBizException {

	}

	public void _update(Context arg0, IObjectPK arg1, IObjectValue arg2)
			throws BOSException, EASBizException {

	}

}
